<template>
  <div v-if="visible" class="modal-overlay" >
    <div class="modal">
      <img
        @click="close"
        class="close-button"
        src="@/static/images/login/icon-close.png"
        alt=""
      />
      <slot></slot>
    </div>
  </div>
</template>
    
 <script>
export default {
  components: {},
  props: {
    visible: {
      type: Boolean,
      default: false,
    },
  },
  data() {
    return {};
  },
  methods: {
    close() {
      this.$emit("closeModal");
      window.location.reload();
    },
  },
};
</script>
    
 <style scoped>
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

.modal {
  width: 620rpx;
  /* height: 399rpx; */
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 46rpx 48rpx 48rpx 48rpx;
  position: relative;
  z-index: 99;
}

.modal button {
  margin-right: 8px;
}

.close-button {
  position: absolute;
  width: 18rpx;
  height: 18rpx;
  top: 18px;
  right: 24px;
}
</style>
    